var queryCourt = $('#query_btn').click(function(){

    var params = {
        "query_text": $('#query_text').val()
    };

    //console.log(params);
    $.ajax({
        url:"http://localhost:8080/gdou_gms/queryVenueAction.action",
        type:"post",
        dataType:"json",
        data:params,
        success:function(data){
            //alert(data);
            var json = eval(data);
            //alert(json);
            if(json != null){
                $("#tab  tr:not(:first)").empty();
                $.each(json, function (index, item) { 
                    //循环获取数据 
                    var s1 =  item.venueId; 
                    var s2 =  item.venueName; 
                    var s3 =  item.sport; 
                    var s4 =  item.openTime;
                    var s5 =  item.closeTime;
                    var s6 =  item.courtNum;
                    
                    var strHtml='<tr><td class="venue_id">'+s1+'</td><td class="venue_name">'+s2+'</td><td class="sport">'+
                    s3+'</td><td class="open_time">'+s4+'</td><td class="close_time">'+s5+'</td><td class="court_num">'+s6+
                    '</td><td><button type="button" class="btn btn-info edit_btn" data-toggle="modal">编辑</button>'+
                    '&nbsp;&nbsp;<button type="button" class="btn btn-danger delete_btn">删除</button></td></tr>';
                     
                    
                    $("#tab").append(strHtml);
                });
            }
        },
        error:function(){
            alert("系统异常，请稍后重试！");
        }
    });   
});